﻿#include "InstructionTurnTableQuitConsole.h"

#include "ScriptRunner.h"
#include "TurnTableCodec.h"

__SCRIPTINSTRUCTION_REGISTER(InstructionTurnTableQuitConsole,ScriptInstruction::Instruction_TurnTable_QuitConsole,&InstructionTurnTableQuitConsole::fromByteArray1);

InstructionTurnTableQuitConsole::InstructionTurnTableQuitConsole()
{
  instructionFlag = Instruction_TurnTable_QuitConsole;
}

InstructionTurnTableQuitConsole::InstructionTurnTableQuitConsole(InstructionTurnTableQuitConsole const& instructionTurnTableQuitConsole)
{
  *this=instructionTurnTableQuitConsole;
}

InstructionTurnTableQuitConsole& InstructionTurnTableQuitConsole::operator=(InstructionTurnTableQuitConsole const & instructionTurnTableQuitConsole)
{
  *(ScriptInstruction*)this=instructionTurnTableQuitConsole;
  return *this;
}

InstructionTurnTableQuitConsole::~InstructionTurnTableQuitConsole()
{}

void InstructionTurnTableQuitConsole::run()
{
  scriptRunner->sendInstruction(deviceId,TurnTableCodec::TurnTable_QuitConsole);
  scriptRunner->scriptWaitAndRun(scriptRunner->getInterval_instruction(),deviceId);
}

QString InstructionTurnTableQuitConsole::toString()
{
  return QStringLiteral("退出转台");
}

QByteArray InstructionTurnTableQuitConsole::toByteArray()
{
  return ScriptInstruction::toByteArray();
}

ScriptInstruction* InstructionTurnTableQuitConsole::fromByteArray1(char * const src,int size,int * offset)
{
  (void)src;
  (void)size;
  (void)offset;
  return new InstructionTurnTableQuitConsole();
}
